package com.lam.system.listener;

import com.lam.common.components.easyexcel.imp.listener.BaseListener;
import com.lam.common.components.easyexcel.imp.model.ImportWrapper;
import com.lam.system.entity.SysPost;
import com.lam.system.entity.imp.SysPostImp;
import com.lam.system.service.SysPostService;

/**
 * 职位信息导入读取类 
 * 此类不能单例，要每次读取excel都要new 
 * @author admin
 *
 */
public class UploadSysPostListener extends BaseListener<SysPostImp, SysPost> {
	
	private SysPostService sysPostService;

	public UploadSysPostListener(SysPostService sysPostService) {
		super(SysPostImp.class, SysPost.class);
		this.sysPostService = sysPostService;
	}

	//重新该方法可自定义校验数据
//	@Override
//	protected String checkData(ImportEntry<SysPostImp, SysPost> entry) {
//		//自定义校验数据逻辑
//		return null;
//	}

	@Override
	protected void saveSuccessData(ImportWrapper<SysPostImp, SysPost> wrapper) {
		
		sysPostService.importData(wrapper);
	}


}
